open ssh server files automatically with apple script

Hello respected persons ,

i am trying to build a apple script which first open terminal login in ssh with details and after login it open a python script which is on ssh server automatically . i wanna do all of these tasks in a single apple script . i already tried to build automatic ssh login and i did . but i am facing problem how can i call a python script in ssh server automatically .

like i have a python file in ssh server /home/exe/ai.py

so i want each time i run that apple script it login in ssh and open ai.py automatically .

i am new in apple script please help 😟

i am trying it fro 3 days but no luck please help me 😟

MacBook Air, OS X El Capitan (10.11.1)

Posted on Feb 18, 2016 2:54 PM

Reply
2 replies

Feb 21, 2016 6:04 PM in response to exe paul

If you simply want to invoke the specified Python on the remote system, then the following shell script (in a filename with a .sh or .command file type to make it execute on double click), with a chmod +x to make the bash shell script executable, should be pretty close:

#!/usr/bin/env bash

ssh user@example.com /path/to/command


Reversing the software stack from your current AppleScript-calling-bash approach, bash can use osascript to access the GUI, too; there are examples of this around.


If you've not encountered it already, Apple has a Shell Scripting Primer.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

open ssh server files automatically with apple script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.